# Remove all Intel PPM packages

# Set temp folder to avoid TEMP and TMP default folder included user name with space
$env:TEMP = $env:ProgramData
$env:TMP = $env:ProgramData

# Remove legacy PPM package
$obj = get-provisioningpackage
#Write-Output $obj.Count

foreach ($ppmpkg in $obj)
{
	Write-Output $ppmpkg.PackageName
    if ($ppmpkg.PackageName -eq "Intel.Power.Settings.Processor") {
		Uninstall-ProvisioningPackage -PackageId $ppmpkg.PackageId
    }

    if ($ppmpkg.PackageName -eq "Power.Settings.Processor.Intel") {
		Uninstall-ProvisioningPackage -PackageId $ppmpkg.PackageId
    }
}


exit 0